<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>配送关系查看</title>
 <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1>配送关系查看</h1>
        <ol class="breadcrumb">
           <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">目录管理</a></li>
            <li class="active"><a href="#">配送关系管理</a></li>
            <li class="active"><a href="#">配送关系查看</a></li>
        </ol>
    </section>
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
              <div class="input">
              		<div class="textalign">配送企业：</div>
                    <div class="boxinput">
                       <input class="textinput" type="text" id="delCompName" name="delCompName" placeholder="配送企业" maxlength="36"/>
                    </div>
                    <div class="textalign">医疗机构：</div>
                    <div class="boxinput">
                        <input class="textinput" type="text" id="hospName" name="hospName" placeholder="医疗机构" maxlength="50" />
                    </div>
                    <div class="textalign" >
                		<button type="button" onclick="search();" class="btn btn-success btn-sm">查&nbsp;询</button>
                 	</div>
              </div>
			</div>
		</div>
<div style="margin-top: 5px;"></div>
	<table class="jqgrid" id="list4"></table>
<div style="margin-top: 10px;"></div>
<div id="prowed2"></div>
	<div class=" box box-warning bottongroup" id="bottongroup">
			<label onClick="toDelCompList();" class="btn btn-default btn-sm">按配送企业设置医疗机构</label>
			<label onClick="toHospList();" class="btn btn-default btn-sm">按医疗机构设置配送企业</label>
	</div>
</section>
<%@ include file="/WEB-INF/component/commonJS.jsp"%>
<script type="text/javascript">
$(document).ready(function (){
	$('.input :input').bind('keydown', function(event) {if (event.keyCode == "13") {search();}}).eq(0).focus();
	jQuery("#list4").jqGrid({
		url: "${ctx}/baseGoods/getProjDrugList.html",
	    mtype: "POST",
		datatype: "json",
		autowidth: true,
		height: 270,
	   	colNames:['delRelId','生产企业编码','生产企业名称','配送企业编码','配送企业名称','医疗机构编码','医疗机构名称',"状态"],
	   	colModel:[
	   		{name:'delRelId',index:'goodsCode',hidden:true,key:true,align:"center",sortable: false},
	   		{name:'prodCompCode',width:48,align:"center", sortable: false},//商品编码
	   		{name:'prodCompName',width:100,sortable: false},
	   		{name:'delCompCode',width:100, align:"left", sortable: false},
	   		{name:'delCompName',width:80, align:"center",sortable: false},
	   		{name:'hospCode',width:60, align:"left",sortable: false},
	   		{name:'hospName',width:80,align:"center", sortable: false},
	   		{name:'status',width:60,align:"center", sortable: false,
	   			formatter:function(cellvalue, options, row){
	                return cellvalue=="0"?"未确认":(cellvalue=="1"?"已确认":"其他");
	            }	
	   		}
	   	
	   	],
		 rowNum: 20,
	     rowList: [10, 20, 50, 100],
	     rownumbers: true,
	     pager: "#prowed2",
	     viewrecords: true,
	     caption: "配送关系管理列表",
	     jsonReader: {
	         repeatitems: false,
	         id: "ids"
	     },
	   gridComplete:function(){
           autoRNWidth("list4");
       }
	   	
	});
})

function search(){
	var delCompName = $.trim($("#delCompName").val());
	var hospName = $.trim($("#hospName").val());
	$("#list4").jqGrid('setGridParam',{  
        datatype:'json',
        postData:{"delCompName":delCompName,
        		"hospName":hospName
        		}
    }).trigger("reloadGrid"); //重新载入  
}
function toDelCompList(){
	if("${isDelrelation}"){
		location.href = "${ctx}/baseGoods/toDelCompList.html";
	}else{
		top.$.HN.message.alert('您尚未获取该操作权限！', '', 'warn');
	}
}
function toHospList(){
	if("${isDelrelation}"){
		location.href = "${ctx}/baseGoods/toHospList.html";
	}else{
		top.$.HN.message.alert('您尚未获取该操作权限！', '', 'warn');
	}
}

</script>
</body>
</html>